package org.crazyit.cloud.key;

import com.netflix.hystrix.HystrixCommand;
import com.netflix.hystrix.HystrixCommandGroupKey;
import com.netflix.hystrix.HystrixCommandKey;
import com.netflix.hystrix.HystrixThreadPoolKey;

/**
 * @Author JLL
 * @Date 2019/2/17/0017 下午 5:39
 */
public class KeyCommand extends HystrixCommand<String> {

    public KeyCommand() {
        super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("TestGroupKey"))
                //这个是命令的key，就是给命令起个名字，可以不需要
                .andCommandKey(HystrixCommandKey.Factory.asKey("CommandKey"))
                .andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey("PoolKey")));
    }

    @Override
    protected String run() throws Exception {
        return "success";
    }


}
